$(function(){
	//后台登录验证  
	var adminname = $('input[name=adminname]');
	var adminpwd = $('input[name=adminpwd]');
	var code = $('input[name=code]');
	adminname.focus(function(){
		$('.admin_user').show();
		$(this).css('border','solid 1px #DCDCDC');
	}).blur(function(){
		if(adminname.val()==''){
			$('.admin_user').html('请输入管理员账号').css('color','red');
		}else if(adminname.val()){
			$('.admin_user').html('输入正确').css('color','green');
		}
	})
	adminpwd.focus(function(){
		$('.admin_pwd').show();
		$(this).css('border','solid 1px #DCDCDC');
	}).blur(function(){
		if(adminpwd.val()==''){
			$('.admin_pwd').html('请输入管理员密码').css('color','red');
		}else if(adminpwd.val()){
			$('.admin_pwd').html('输入正确').css('color','green');
		}
	})
	code.focus(function(){
		$(this).css('border','solid 1px #DCDCDC');
	})
	//没有输入值不允许提交
	$('.submit').click(function(){
				
		if(adminname.val()== ''){
			adminname.css('border','1px solid red');
			$('.admin_user').show().html('请输入管理员账号').css('color','red');
		}
		if(adminpwd.val()== ''){
			adminpwd.css('border','1px solid red');
			$('.admin_pwd').show().html('请输入管理员账号').css('color','red');
		}
		if(code.val()== ''){
			code.css('border','1px solid red');
		}
		if(adminname.val()== '' | adminpwd.val()== '' | code.val()== ''){
			return false;
		}
	})
	

})